import json

def Remember():
    
    file_name = 'name.json'
    
    name = input("请输入你的名字: ")
    with open(file_name, 'w') as f:
        json.dump(name, f)

def greet_user():
    file_name = 'name.json'
    name1 = input("你的名字是？")
    file_exists = True
    try:
        with open(file_name, 'r') as f:
            name = json.load(f)
    except FileNotFoundError:
        file_exists = False
   
    if file_exists:
   
        if name != name1:
            print("请重新输入名字")
            Remember()
       
        else:
            print("欢迎回来")
    else:
        print("没找到，请重新输入")
        Remember()


greet_user() 

greet_user() 
